<?php
/**
 * @version		$Id:  $
 * @package		Success Framework Mobile
 * @subpackage	Session
 * @copyright	Copyright (C) 2007 - 2010 Success company - VietNam. All rights reserved.
 */
defined('PATH_BASE') or die();
/**
 * Object class, allowing __construct in PHP4.
 *
 * @package		Success.Framework
 * @subpackage	Base
 * @since		1.0
 */
 
class sscls_Session
{
    /**
	 * set value for session with name is name.
	 *
	 * @param name,value,pexi is defined.
	 * @return True
	 */
     
    function set($name,$value,$pexi='')
    {
        if($pexi=='')
        {
            $sid=md5($_SERVER [ 'REMOTE_ADDR' ]);
        }
        else
        {
            $sid=md5($pexi);
        }
        @session_start();
        @$_SESSION[$sid][$name]=$value;
        return true;
    }

    /**
	 * get value of session with name is name.
	 *
	 * @param name,pexi is defined.
	 * @return value
     */
         
    function get($name,$pexi='')
    {
        @session_start();
        if($pexi=='')
        {
            $sid=md5($_SERVER [ 'REMOTE_ADDR' ]);
        }
        else
            {
                $sid=md5($pexi);
            }
        return @$_SESSION[$sid][$name];
    }
    
    /**
	 * return session id.
	 *
	 * @param null.
	 * @return sessionid
     */
    
    function getSessionID()
    {       
        return @session_id();
    }
}
?>